package com.iot.ammeter.ui.components.fillrecord

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Button
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import com.iot.ammeter.IApplication
import com.iot.ammeter.R
import com.iot.ammeter.common.rmbString


/**
 * 余额显示
 */
@Composable
internal fun BalanceCard() = Column(
    horizontalAlignment = Alignment.CenterHorizontally,
    modifier = Modifier
        .fillMaxWidth()
        .padding(30.dp, 20.dp)
) {
    Text(
        text = stringResource(id = R.string.balance_fill_balance),
        style = MaterialTheme.typography.titleLarge,
        color = MaterialTheme.colorScheme.onBackground
    )
    Text(
        text = rmbString(balance = IApplication.userInfo!!.balance),
        modifier = Modifier.padding(0.dp, 10.dp, 0.dp, 20.dp),
        style = MaterialTheme.typography.titleLarge,
        color = MaterialTheme.colorScheme.onBackground
    )
    Button(onClick = { /*TODO*/ }, modifier = Modifier.fillMaxWidth()) {
        Text(text = stringResource(id = R.string.balance_fill_balance))
    }
}
